<template>
  <div class="container">
    <!-- 头部渐变背景   -->
    <div class="bg-color" :style="{backgroundImage:'linear-gradient('+ bgColor +' 20%, #f5f5f5 80%)'}"></div>
    <div>
      <!-- 分销 确认订单 -->
      <!-- <distribution-type v-if="showDistribution"></distribution-type> -->
      <community-type v-if="orderType === 1 || orderType === 2"></community-type>
      <!-- 社区团购 门店 -->
      <other-type v-else></other-type>
    </div>
  </div>
</template>

<script>
import DistributionType from './components/DistributionType.vue'
import OtherType from './components/OtherType.vue'
import CommunityType from './components/CommunityType.vue'
export default {
  components: {
    DistributionType,
    OtherType,
    CommunityType
  },
  data() {
    return {
      bgColor: '#FF243D',
      orderType: '',
      showDistribution: false // 是否走社群分销流程
    }
  },
  onLoad(params) {
    if ('orderType' in params) {
      this.orderType = Number(params.orderType)
    }
    // console.log(this.orderType)
  },
  mounted() {
    this.initPage()
  },
  methods: {
    initPage() {
      wx.setNavigationBarColor({
        frontColor: '#ffffff',
        backgroundColor: '#FF243D'
      })
    }
  }
}
</script>
<style lang="less" scoped>
  .container {
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
    .bg-color {
      height: 246px;
      box-sizing: border-box;
      position: absolute;
      width: 100%;
      top: 0;
      left: 0;
      z-index: -1;
    }
  }
</style>